package com.chentf.behavioral.strategy.code.b;

public class Order {

    private DiscountStrategy discountStrategy;

    public Order(DiscountStrategy discountStrategy) {
        this.discountStrategy = discountStrategy;
    }

    public double getTotalAmount() {
        // 假设总金额为1000元
        return 1000.0;
    }

    public double calculateDiscount() {
        return discountStrategy.calculateDiscount(this);
    }
}
